﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;

namespace IronCommander
{
    public class FileStructureGenerator
    {
        public void GenerateManyFiles()
        {
            var folder = @"d:\temp\files";

            Directory.CreateDirectory(folder);

            var items = Observable.Range(0, 1000 * 100).Publish();
            items.Where(i => i % 10000 == 0).Subscribe(i => Debug.WriteLine(i));
            items.Subscribe(v => File.WriteAllText(Path.Combine(folder, string.Format("File {0}", v)), v.ToString()));
            items.Connect();
        }
    }
}
